﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Whir_System_Module_Template_SetFormLabel : System.Web.UI.Page
{
    protected char isPostBack;    //是否第一次访问

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            this.isPostBack = '0';
        else
            this.isPostBack = '1';
    }

    //绑定表单
    protected void btnF_Click(object sender, EventArgs e)
    {
        //绑定并选择字段
        this.DataSourceSelect1.BindData();

        if (this.hfSelect.Value != "*")
        {
            string select = "," + this.hfSelect.Value + ",";
            CheckBoxList cbl = this.DataSourceSelect1.FindControl("cblField") as CheckBoxList;

            for (int i = 0; i < cbl.Items.Count; i++)
            {
                string v = "," + cbl.Items[i].Text.Split(' ')[0] + ",";
                if (select.IndexOf(v) != -1)
                    cbl.Items[i].Selected = true;
            }
        }
    }
}
